package com.lucy.starter.config;

import com.lucy.starter.loader.AdminAuthService;
import com.lucy.starter.loader.AuthService;
import com.lucy.starter.loader.DefaultAdminAuthServiceImpl;
import com.lucy.starter.loader.DefaultAuthServiceImpl;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * @author kindear
 * 服务实现配置
 */
@SpringBootConfiguration
public class ServiceConfig {
    @Bean
    @ConditionalOnMissingBean(value = AuthService.class)
    public AuthService authService() {
        return new DefaultAuthServiceImpl();
    }

    @Bean
    @ConditionalOnMissingBean(value = AdminAuthService.class)
    public AdminAuthService adminAuthService(){
        return new DefaultAdminAuthServiceImpl();
    }

}
